package 笔试;

/**
 * @Date 2024/11/2 17:23
 * @description: 传音笔试
 * .
 * @Author LittleNight
 */
public class chaunyin {

    // 判断两个字符串是不是互为逆字符串
    public static boolean isReverse(String str1, String str2) {
        // 判断长度是否相等
        if (str1.length() != str2.length()) {
            return false;
        }
        // 倒序
        StringBuilder sb = new StringBuilder(str1);

        String reverseStr1 = sb.reverse().toString();
        // 比较
        return reverseStr1.equals(str2);
    }
}
